<template>
  <div id="nav">
    <router-link to="/">Home</router-link> |
    <router-link to="/about">About</router-link> |
    <router-link to="/tfjs">tfjs</router-link>|
    <router-link to="/arithmetic">算法练习</router-link>
<!--    <div @click="send">按钮</div>-->
<!--    <div @click="send1">按钮1</div>-->
  </div>
  <router-view/>
</template>

<script lang="ts">
// import webstomp from 'webstomp-client'
// import SockJS from 'sockjs-client'
// const url = 'http://172.16.6.83:8899/websocket-yxqn'
// // const url = 'http://172.16.5.39:9010/stomp?name=huang'
// const sock = new SockJS(url, null, {
//   sessionId: 1231
// })
// const client = webstomp.over(sock, {})
// client.connect(
//   {
//     name: 'huang',
//     login: '12312412123',
//     passcode: 'passcode',
//     token: 'token'
//   },
//   (frame: any) => {
//     console.info(123123)
//     console.log(frame.body, 'frame')
//     console.log(frame.headers)
//   }
// )

const initials = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j']
export default {
  data () {
    return {
      options: Array.from({ length: 1000 }).map((_, idx) => ({
        value: `Option ${idx + 1}`,
        label: `${initials[idx % 10]}${idx}`
      })),
      value: null
    }
  },
  created () {
    // sock.onopen = function () {
    //   console.log('open')
    //   client.subscribe('/topic/getResponse', (data: unknown) => {
    //     console.log(data, 'data')
    //   })
    //   client.subscribe('/user/huang/queue', (data: unknown) => {
    //     console.log(data, 'data:huang')
    //   })
    // }
    //
    // sock.onmessage = function (e) {
    //   console.log('message', e.data)
    //   // sock.close()
    // }
    // sock.onclose = function () {
    //   console.log('close')
    // }
  },
  methods: {
    // send () {
    //   client.send('/app/receive', JSON.stringify({ name: 'a message' }))
    // },
    // send1 () {
    //   client.send('/webSocket/message', JSON.stringify({
    //     message: 123,
    //     datetime: '2019-09-25',
    //     from: 'huang',
    //     to: 'huanga'
    //   }))
    // }
  }
}
</script>

<style lang="less">
#app {
  font-family: Avenir, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-align: center;
  color: #2c3e50;
}

#nav {
  padding: 30px;

  a {
    font-weight: bold;
    color: #2c3e50;

    &.router-link-exact-active {
      color: #42b983;
    }
  }
}
</style>
